#include <sys_head.h>

int main(int argc, char const *argv[])
{
    //int fd = open("a.c",O_RDONLY);
    pid_t pid = fork();
    if (0 == pid)
    {
        int newSidID = setsid();
        printf("子进程建立了新的会话%d\n",newSidID);
        chdir("/home/student/桌面");
        umask(0);
        //close(fd);
        while (1)
        {
            system("rm -rf *.txt");
            sleep(1);
        }
        
    }
    else if (0 < pid)
    {
        exit(0);
    }
    
    return 0;
}
